﻿<div class="datagrid-toolbar formToolBar">
    <a href="#" class="easyui-linkbutton" plain="true" onclick="saveFormData()" iconcls="iconfont iconfont-baocun">保存</a>
</div>
<div style="padding:2px;">
    <form id="mf_form" method="post">
        <table class="groupTable">
            <tr>
                <td style="width:30%">是否必填:</td>
                <td style="width:70%">
                    <input id="required" name="required" class="easyui-combobox" data-options="data:truefalseType,panelHeight:'auto',editable:false" style="width:100%" />
                </td>                
            </tr>
            <tr>
                <td>
                    可否输入:
                </td>
                <td>
                    <input id="editable" name="editable" class="easyui-combobox" data-options="data:truefalseType,panelHeight:'auto',editable:false" style="width:100%" />
                </td>
            </tr>
            <tr>
                <td>
                    空文本提示:
                </td>
                <td>
                    <input id="prompt" name="prompt" class="easyui-textbox" style="width:100%" />
                </td>
            </tr>
            <tr>
                <td>
                    数据源:
                </td>
                <td>
                    <input id="SourceType" name="SourceType" class="easyui-mfbuttonedit" data-options="textName:'SourceValue',onButtonClick:dataBtnClick" style="width:100%" />
                </td>
            </tr>
            <tr>
                <td>
                    是否多选:
                </td>
                <td>
                    <input id="multiple" name="multiple" class="easyui-combobox" data-options="data:truefalseType,panelHeight:'auto',editable:false" style="width:100%" />
                </td>
            </tr>
            <tr>
                <td>
                    控件宽度：
                </td>
                <td>
                    <input id="style_width" name="style_width" class="easyui-textbox" value="100%" style="width: 100%" />
                </td>
            </tr>
            <tr>
                <td>
                    下拉面板高度：
                </td>
                <td>
                    <input name="panelHeight" class="easyui-textbox" value="300" style="width: 100%" />
                </td>
            </tr>
        </table>
    </form>
</div>
<script>    
    @Html.GetEnum(typeof(MF_Base.truefalseType), "False")
    var valType = [{ text: "email", value: "email" }];
</script>
<script>
    function pageLoad() {
        if (queryString("SearchCtrl") == 'true') {
            $('#required').combobox('readonly', true);
            $('#editable').combobox('readonly', true);
            $('#multiple').combobox('readonly', true);
            $('#style_width').textbox('readonly', true);
        }
    }

    function dataBtnClick(e) {
        var val = e.value;
        var text = e.text;
        var param = {
            SourceType: val,
            SourceText: text
        }

        openWindow('/AutoUI/ConfigUIDef/FormCtrlDetail/EnumDef', {
            width: 300, height: 400,
            data: param,
            onDestroy: function (res) {
                if (res) {
                    var sourceType = res.SourceType;
                    var sourceText = res.SourceText;
                    $('#SourceType').mfbuttonedit('setValue', sourceType);
                    $('#SourceType').mfbuttonedit('setText', sourceText);
                }
            }
        });
    }
</script>